package com.jddup.program.dao.sqlbuilder.sqlserver;

import com.jddup.common.pojo.TableMeta;
import com.jddup.program.dao.sqlbuilder.DeletePrepareSQLBuilder;

/**
 * Mysql 删除SQL构建器
 * Created by ZZB on 2017/10/19.
 */
public class SqlServerDeletePrepareSQLBuilder implements DeletePrepareSQLBuilder {
	private static final String DELETE_BY_PK_FMT = "delete from [{tableName}] where [{pkName}] = ?";

	@Override
	public String buildDeleteSQL(TableMeta tableMeta) {
		return DELETE_BY_PK_FMT.replace("{tableName}", tableMeta.getTableName()).replace("{pkName}",
				tableMeta.getPrimaryKeyColumn().getColumnName() );
	}
}
